let { registerChildrenRoute } = require("../../framework/js/route");

var productmeta = {
    interceptor: function (to, from, userInfo) {
        if (userInfo) {
            var arr = ["/admin/software/add", "/admin/software/edit"];
            if (userInfo.admin_is_super != 1) {
                for (var i = 0; i < arr.length; i++) {
                    if (to.fullPath.indexOf(arr[i]) > -1) {
                        return false;
                    }
                }
            }
        }
        return true;
    }
};


module.exports = [
    {
        name: "使用",
        path: "/admin/index",
        component: require("./index.js"),
        icon: "iconfont icon-account icon text-info-dker",
        children: registerChildrenRoute('/admin/index', [
            {
                path: '',
                name: "index",
                component: require("./index_1.js")
            }
        ])
    },
    {
        name: "style",
        path: "/admin/style",
        component: require("./index.js"),
        icon: "glyphicon glyphicon-stats icon text-primary-dker",
        children: registerChildrenRoute('/admin/style', [
            {
                path: '',
                name: "工具类",
                component: require("./style_1.js")
            }
        ])
    },
    {
        name: "UI",
        path: "/admin/ui",
        icon: "iconfont icon-cash-usd icon text-info-dker",
        component: require("./ui.js"),
        children: registerChildrenRoute('/admin/ui', [
            {
                path: '',
                name: "grid",
                component: require("./ui_1.js")
            },
            {
                path: 'form',
                name: "form",
                component: require("./ui_2.js")
            },
            {
                path: 'modal',
                name: "modal",
                component: require("./ui_3.js")
            },
            {
                path: 'tab',
                name: "tab",
                component: require("./ui_4.js")
            },
            {
                path: 'notification',
                name: "notification",
                component: require("./ui_5.js")
            },
            {
                path: 'select',
                name: "select",
                component: require("./ui_6.js")
            },
            {
                path: 'chart',
                name: "chart",
                component: require("./ui_7.js")
            },
            {
                path: 'pagination',
                name: "pagination",
                component: require("./ui_8.js")
            },
            {
                path: 'datatable',
                name: "datatable",
                component: require("./ui_9.js")
            },
            {
                path: 'loading',
                name: "loading",
                component: require("./ui_10.js")
            },
            {
                path: 'datagrid',
                name: "datagrid",
                component: require("./ui_11.js")
            },
            {
                path: 'tootltip',
                name: "tootltip",
                component: require("./ui_12.js")
            },
            {
                path: 'icons',
                name: "icons",
                component: require("./ui_13.js")
            },
            {
                path: 'steps',
                name: "steps",
                component: require("./ui_14.js")
            },
            {
                path: 'i18n',
                name: "i18n",
                component: require("./ui_15.js")
            },
        ])
    }
];